﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WMSSoft.WinKStart.ViewModel;
using WMSSoft.Lib.WinKStart.ViewModel;

namespace WMSSoft.WinKStart
{
    /// <summary>
    /// Interaktionslogik für tmpSettings.xaml
    /// </summary>
    public partial class Settings : Window
    {
        public CSettingsViewModel m_ViewModel = null;

        public CSettingsViewModel ViewModel
        {
            get { return m_ViewModel; }
            set {
                m_ViewModel = value;
            }
        }

        public Settings()
        {
            //ViewModel = new CSettingsViewModel();
            //this.DataContext = ViewModel;

            InitializeComponent();                       
            
        }

        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            try
            {
                if (m_ViewModel != null)
                {
                    m_ViewModel.SetSelectedOption((CSingleSettingOptionViewModel)e.NewValue);
                }
            }
            catch (Exception Ex)
            {

            }
        }

    }
}
